// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "LyraGameplayAbility.h"

#include "LyraGameplayAbility_Jump.generated.h"

class UObject;
struct FFrame;
struct FGameplayAbilityActorInfo;
struct FGameplayTagContainer;

/**
 * ULyraGameplayAbility_Jump
 *
 *	用于角色跳跃的游戏玩法能力。
 */
UCLASS(Abstract)
class ULyraGameplayAbility_Jump : public ULyraGameplayAbility
{
	GENERATED_BODY()

public:

	ULyraGameplayAbility_Jump(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());

protected:

	/**
	 * 检查能力是否可以被激活。
	 * @param Handle 能力规格句柄
	 * @param ActorInfo 能力执行者信息
	 * @param SourceTags 源标签容器
	 * @param TargetTags 目标标签容器
	 * @param OptionalRelevantTags 可选相关标签容器
	 * @return 如果能力可以激活则返回true，否则返回false
	 */
	virtual bool CanActivateAbility(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayTagContainer* SourceTags, const FGameplayTagContainer* TargetTags, FGameplayTagContainer* OptionalRelevantTags) const override;
	
	/**
	 * 结束能力时调用。
	 * @param Handle 能力规格句柄
	 * @param ActorInfo 能力执行者信息
	 * @param ActivationInfo 能力激活信息
	 * @param bReplicateEndAbility 是否复制结束能力
	 * @param bWasCancelled 能力是否被取消
	 */
	virtual void EndAbility(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo, bool bReplicateEndAbility, bool bWasCancelled) override;

	/**
	 * 开始角色跳跃。
	 */
	UFUNCTION(BlueprintCallable, Category = "Lyra|Ability")
	void CharacterJumpStart();

	/**
	 * 停止角色跳跃。
	 */
	UFUNCTION(BlueprintCallable, Category = "Lyra|Ability")
	void CharacterJumpStop();
};